<template>
  <div class="header">
    <div class="wrap">
      <div class="b" onclick="_methods.goBack()">
        <i class="iconfont icon-tuihui b-i"></i>
      </div>
      <h1 class="t" :class="headerAnimate_get">
        <span>{{title}}</span>
      </h1>
      <transition-group name="fadeShow">
        <!--添加icon-->
        <div class="r"
             :key="1"
             v-if="headerRightType.val == 999"
             @click="_rightTxtClick">
          <i class="iconfont icon-tianjia b-i"></i>
        </div>
        <div class="r con"
             :key="2"
             v-if="headerRightType.val != 99"
             @click="_rightTxtClick">
          {{headerRightType.txt}}
        </div>
        <div class="r"
             :key="1"
             v-if="headerRightType.val == 998"
             @click="_rightTxtClick">
          <i class="iconfont icon-fangdajing b-i"></i>
        </div>
      </transition-group>
    </div>
  </div>
</template>

<script>
  import {mapGetters, mapState} from 'vuex'
  export default {
    methods: {
      _rightTxtClick(){
        _data.bus.$emit(_data.headerClick.emitLabel + this.headerRightType.val,this.headerRightType);
      },
    },
    computed: {
      ...mapState([
        'title',
        'headerAnimate_get',
        'headerRightType',
      ]),
      ...mapGetters([
        'headerAnimate_get',
      ])
    }
  }
</script>
